package com.summer.filesync.model.manager;

import java.time.LocalDateTime;

/** 文件版本 */
public class FileVersion {
  private String versionId;
  private String filePath;
  private String comment;
  private long fileSize;
  private String checksum;
  private LocalDateTime createdTime;
  private String createdBy;
  private String backupPath;
  private boolean isCurrent;

  public FileVersion() {}

  public FileVersion(String filePath, String comment, long fileSize, String checksum) {
    this.versionId = generateVersionId();
    this.filePath = filePath;
    this.comment = comment;
    this.fileSize = fileSize;
    this.checksum = checksum;
    this.createdTime = LocalDateTime.now();
    this.createdBy = System.getProperty("user.name", "system");
    this.isCurrent = false;
  }

  private String generateVersionId() {
    return java.util.UUID.randomUUID().toString();
  }

  // Getters and Setters
  public String getVersionId() {
    return versionId;
  }

  public void setVersionId(String versionId) {
    this.versionId = versionId;
  }

  public String getFilePath() {
    return filePath;
  }

  public void setFilePath(String filePath) {
    this.filePath = filePath;
  }

  public String getComment() {
    return comment;
  }

  public void setComment(String comment) {
    this.comment = comment;
  }

  public long getFileSize() {
    return fileSize;
  }

  public void setFileSize(long fileSize) {
    this.fileSize = fileSize;
  }

  public String getChecksum() {
    return checksum;
  }

  public void setChecksum(String checksum) {
    this.checksum = checksum;
  }

  public LocalDateTime getCreatedTime() {
    return createdTime;
  }

  public void setCreatedTime(LocalDateTime createdTime) {
    this.createdTime = createdTime;
  }

  public String getCreatedBy() {
    return createdBy;
  }

  public void setCreatedBy(String createdBy) {
    this.createdBy = createdBy;
  }

  public String getBackupPath() {
    return backupPath;
  }

  public void setBackupPath(String backupPath) {
    this.backupPath = backupPath;
  }

  public boolean isCurrent() {
    return isCurrent;
  }

  public void setCurrent(boolean current) {
    isCurrent = current;
  }
}
